import { getAppId } from '@/utils/local'; //

const state = {
  app: {
    appId: ''
  }
};

const mutations = {
  changeAppid: (state, appid) => {
    state.app.appId = appid;
  }
};

const actions = {
  actionToken: ({ commit, state }, info) => {
    state.userIdentity = info.trueName;
    commit('setToken', info.token);
  }
};

const appId = getAppId();
if (appId) {
  mutations.changeAppid(state, appId);
}

export default {
  namespaced: true,
  state,
  mutations,
  actions
};
